package com.fanh.service;

import com.fanh.model.SysUser;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;
import java.util.Map;

public interface UserService {


    List<SysUser> getUser(SysUser user);
    /**
     * 手机用户注册
     * @param phone
     * @param name
     * @param password
     * @return
     */
    @Transactional
    SysUser phoneRegist(String phone, String name,  String password);


    UserDetails loadUserByUsername(String username);


     String login(String userName,String password);

    /**
     * 微信登录
     * @param accessToken
     * @param openId
     * @return
     */
    Map<String, Object> wxlogin(String accessToken, String openId);

    /**
     * 绑定微信
     * @param openId
     * @return
     */
    int bingWx(String accessToken,String openId);
    /**
     * 忘记密码，重置
     */
    int modifyPassword(String phone, String sessionId, String verificationCode,  String newPassword);

    /**
     * 个人信息修改
     * @param user
     * @param file
     * @return
     */
    SysUser modifyUser(SysUser user, MultipartFile file);

    /**
     * 获取当前用户
     * @return
     */
    SysUser getCurrentSysUser();
}
